home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1997
/
MacHack 1997.toast
/
Hacks
/
Hacks ’96
/
VideoFolder 1.0a
/
Source
/
VideoFolderApp.cp
< prev
next >
Wrap
Text File
|
1996-06-22
|
5KB
|
179 lines
// ===========================================================================
// <PP Starter Source>.cp ©1994-1996 Metrowerks Inc. All rights reserved.
// ===========================================================================
//
// This file contains the starter code for a PowerPlant application
#include "VideoFolderApp.h"
#include <LGrowZone.h>
#include <LWindow.h>
#include <PP_Messages.h>
#include <PP_Resources.h>
#include <PPobClasses.h>
#include <UDrawingState.h>
#include <UMemoryMgr.h>
#include <URegistrar.h>
#include <LEditField.h>
#include "DateTimeDisplayPane.h"
#include "FSSpecPane.h"
#include "SequenceGrabberPane.h"
#include "VideoFolderDocument.h"
#include "VideoFolderWindow.h"
#include <UModalDialogs.h>
// put declarations for resource ids (ResIDTs) here
// ===========================================================================
// • Main Program
// ===========================================================================
void main(void)
{
// Set Debugging options
#if debug
SetDebugThrow_(debugAction_SourceDebugger );
SetDebugSignal_(debugAction_SourceDebugger );
#else
SetDebugThrow_(debugAction_Nothing );
SetDebugSignal_(debugAction_Nothing );
#endif
InitializeHeap(3); // Initialize Memory Manager
// Parameter is number of Master Pointer
// blocks to allocate
// Initialize standard Toolbox managers
UQDGlobals::InitializeToolbox(&qd);
new LGrowZone(20000); // Install a GrowZone function to catch
// low memory situations.
VideoFolderApp theApp; // replace this with your App type
theApp.Run();
}
// ---------------------------------------------------------------------------
// • VideoFolderApp // replace this with your App type
// ---------------------------------------------------------------------------
// Constructor
VideoFolderApp::VideoFolderApp()
{
// Register functions to create core PowerPlant classes
RegisterAllPPClasses();
URegistrar::RegisterClass(SequenceGrabberPane::class_ID, (ClassCreatorFunc) SequenceGrabberPane::CreateSequenceGrabberPaneStream);
URegistrar::RegisterClass(VideoFolderWindow::class_ID, (ClassCreatorFunc) VideoFolderWindow::CreateVideoFolderWindowStream);
URegistrar::RegisterClass(DateTimeDisplayPane::class_ID, (ClassCreatorFunc) DateTimeDisplayPane::CreateDateTimeDisplayPaneStream );
URegistrar::RegisterClass(FSSpecPane::class_ID, (ClassCreatorFunc) FSSpecPane::CreateFSSpecPaneStream );
URegistrar::RegisterClass(LCicnButton::class_ID, (ClassCreatorFunc) LCicnButton::CreateCicnButtonStream );
}
// ---------------------------------------------------------------------------
// • ~VideoFolderApp // replace this with your App type
// ---------------------------------------------------------------------------
// Destructor
//
VideoFolderApp::~VideoFolderApp()
{
}
// ---------------------------------------------------------------------------
// • StartUp
// ---------------------------------------------------------------------------
// This function lets you do something when the application starts up
// without a document. For example, you could issue your own new command.
void
VideoFolderApp::StartUp()
{
ObeyCommand(cmd_New, nil); // EXAMPLE, create a new window
}
// ---------------------------------------------------------------------------
// • ObeyCommand
// ---------------------------------------------------------------------------
// Respond to commands
Boolean
VideoFolderApp::ObeyCommand(
CommandT inCommand,
void *ioParam)
{
Boolean cmdHandled = true;
switch (inCommand) {
default:
cmdHandled = LDocApplication::ObeyCommand(inCommand, ioParam);
break;
}
return cmdHandled;
}
// ---------------------------------------------------------------------------
// • FindCommandStatus
// ---------------------------------------------------------------------------
// This function enables menu commands.
//
void
VideoFolderApp::FindCommandStatus(
CommandT inCommand,
Boolean &outEnabled,
Boolean &outUsesMark,
Char16 &outMark,
Str255 outName)
{
switch (inCommand) {
// Return menu item status according to command messages.
// Any that you don't handle will be passed to LApplication
default:
LDocApplication::FindCommandStatus(inCommand, outEnabled,
outUsesMark, outMark, outName);
break;
}
}
LModelObject* VideoFolderApp::MakeNewDocument()
{ VideoFolderDocument* doc = new VideoFolderDocument ( this, nil);
return doc;
}
void VideoFolderApp::ChooseDocument()
{ StandardFileReply reply;
SFTypeList typeList = { 'VFol', 0, 0, 0 };
UDesktop::Deactivate();
::StandardGetFile ( nil, 1, typeList, & reply );
UDesktop::Activate();
if ( reply.sfGood )
SendAEOpenDoc ( reply.sfFile );
}
void VideoFolderApp::OpenDocument( FSSpec *inMacFSSpec)
{
VideoFolderDocument* doc = new VideoFolderDocument ( this, nil );
}
void VideoFolderApp::ShowAboutBox()
{ StDialogHandler aboutBox ( 128, this );
aboutBox.DoDialog(); // != msg_OK )
;
}